var gl_bed_vue_vm_list_html = $('#bed_vue_vm_list').html();

$(function() {
	$('#bed_vue_vm_list div').hide();
});

load_bed_by_floorId = function(floorId) {
	if($('#bed_vue_vm_list').length==0) {return;}
	$('#bed_vue_vm_list div').hide();

	find_basic_by_json(path+'/bed/findByFloorId', {floorId: floorId}, function(response) {
		$('#bed_vue_vm_list').html(gl_bed_vue_vm_list_html);
		
		new Vue({
			el: '#bed_vue_vm_list',
			data: {
				todos: response.data
			},
			methods: {
				
			}
		});
		
		$('#bed_vue_vm_list div').show();
	});
}

/*
var onClickBedRadiobox=function(bed) {
	var bedId = $('input:radio[name="bedId"]:checked').val();
	if(bedId==bed.bedId) {
		view.data.buildingId = bed.buildingId;
		view.data.buildingName = bed.buildingName;
		view.data.floorId = bed.floorId;
		view.data.floorName = bed.floorName;
		view.data.roomId = bed.roomId;
		view.data.roomName = bed.roomName;
		view.data.bedId = bed.bedId;
		view.data.bedNumber = bed.bedNumber;
	}
}
*/

function onClickBedRadiobox(obj) {
	var bedId = $('input:radio[name="bedId"]:checked').val();
	var bedIdAttr = $(obj).attr('bedId');
	if(bedId==bedIdAttr) {
		view.data.buildingId = $(obj).attr('buildingId');
		view.data.buildingName = $(obj).attr('buildingName');
		view.data.floorId = $(obj).attr('floorId');
		view.data.floorName = $(obj).attr('floorName');
		view.data.roomId = $(obj).attr('roomId');
		view.data.roomNumber = $(obj).attr('roomNumber');
		view.data.roomType = $(obj).attr('roomType');
		view.data.bedId = $(obj).attr('bedId');
		view.data.bedNumber = $(obj).attr('bedNumber');
	}
}